package miao.demo.service.impl;

import miao.demo.dao.BookDao;
import miao.demo.service.BookService;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

public class BookServiceImpl implements BookService, InitializingBean, DisposableBean {
    private BookDao bookDao;

    @Override
    public void save() {
        System.out.println("book service save....");
    }

    public void setBookDao(BookDao bookDao) {
        System.out.println("set....");
        this.bookDao = bookDao;
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("service destroy....");
    }

    //在set方法之后
    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("service init...");
    }
}
